package com.ruoyi.supplier.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.supplier.mapper.TbBankIncomeNameMapper;
import com.ruoyi.supplier.domain.TbBankIncomeName;
import com.ruoyi.supplier.service.ITbBankIncomeNameService;

/**
 * 进账名目Service业务层处理
 * 
 * @author oliver.li
 * @date 2021-08-14
 */
@Service
public class TbBankIncomeNameServiceImpl implements ITbBankIncomeNameService 
{
    @Autowired
    private TbBankIncomeNameMapper tbBankIncomeNameMapper;

    /**
     * 查询进账名目
     * 
     * @param id 进账名目ID
     * @return 进账名目
     */
    @Override
    public TbBankIncomeName selectTbBankIncomeNameById(Long id)
    {
        return tbBankIncomeNameMapper.selectTbBankIncomeNameById(id);
    }

    /**
     * 查询进账名目列表
     * 
     * @param tbBankIncomeName 进账名目
     * @return 进账名目
     */
    @Override
    public List<TbBankIncomeName> selectTbBankIncomeNameList(TbBankIncomeName tbBankIncomeName)
    {
        return tbBankIncomeNameMapper.selectTbBankIncomeNameList(tbBankIncomeName);
    }

    /**
     * 新增进账名目
     * 
     * @param tbBankIncomeName 进账名目
     * @return 结果
     */
    @Override
    public int insertTbBankIncomeName(TbBankIncomeName tbBankIncomeName)
    {
        tbBankIncomeName.setCreateTime(DateUtils.getNowDate());
        return tbBankIncomeNameMapper.insertTbBankIncomeName(tbBankIncomeName);
    }

    /**
     * 修改进账名目
     * 
     * @param tbBankIncomeName 进账名目
     * @return 结果
     */
    @Override
    public int updateTbBankIncomeName(TbBankIncomeName tbBankIncomeName)
    {
        tbBankIncomeName.setUpdateTime(DateUtils.getNowDate());
        return tbBankIncomeNameMapper.updateTbBankIncomeName(tbBankIncomeName);
    }

    /**
     * 批量删除进账名目
     * 
     * @param ids 需要删除的进账名目ID
     * @return 结果
     */
    @Override
    public int deleteTbBankIncomeNameByIds(Long[] ids)
    {
        return tbBankIncomeNameMapper.deleteTbBankIncomeNameByIds(ids);
    }

    /**
     * 删除进账名目信息
     * 
     * @param id 进账名目ID
     * @return 结果
     */
    @Override
    public int deleteTbBankIncomeNameById(Long id)
    {
        return tbBankIncomeNameMapper.deleteTbBankIncomeNameById(id);
    }
}
